  import { useContext } from "react"
import { Context } from "./UseContextDemo"
export default function SonCom(){

  const context:any= useContext(Context);

    console.log(context);
    
return (
     <div style={{background:'red',width:600,height:200,color:'#fff'}}>
          {context.title}
          
          子组件2
            <button onClick={()=>{

context.setTitle("hello world");

            }}>修改</button>
          </div>
)
}